﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Kinect.Framework.Controls;
using Kinect.Framework.Lib;

namespace Kinect.ShowCase.Views
{
    /// <summary>
    /// Interaction logic for GestureView.xaml
    /// </summary>
    public partial class GestureView : UserControl
    {
        public GestureView()
        {
            InitializeComponent();
            Loaded += new RoutedEventHandler(GestureView_Loaded);
        }

        void GestureView_Loaded(object sender, RoutedEventArgs e)
        {
            ((MainWindow)KinectWindow.GetWindow(this)).ContextMenu.IsEnabled = false;
            KinectWindow.GestureController(this).WaveManipulationDetected += new Framework.Controller.KinectManipulationController.WaveManipulationDetectedEventHandler(MainWindow_WaveManipulationDetected);
            KinectWindow.GestureController(this).SteadyManipulationDetected += new Framework.Controller.KinectManipulationController.SteadyManipulationDetectedEventHandler(MainWindow_SteadyManipulationDetected);
            KinectWindow.GestureController(this).PushManipulationDetected += new Framework.Controller.KinectManipulationController.PushManipulationDetectedEventHandler(MainWindow_PushManipulationDetected);
            KinectWindow.GestureController(this).SwipeManipulationDetected += new Framework.Controller.KinectManipulationController.SwipeManipulationDetectedEventHandler(MainWindow_SwipeManipulationDetected);
        }
        void MainWindow_SwipeManipulationDetected(object s, PayloadEventArgs<KinectSwipeManipulation> e)
        {
            GestureMode.Text = "Swipe manipulation detected";
        }

        void MainWindow_PushManipulationDetected(object s, PayloadEventArgs<KinectManipulationBase> e)
        {
            GestureMode.Text = "Push manipulation detected";
        }

        void MainWindow_SteadyManipulationDetected(object s, PayloadEventArgs<KinectPointer> e)
        {
            GestureMode.Text = "Steady manipulation detected";
        }

        void MainWindow_WaveManipulationDetected(object s, EventArgs e)
        {
            GestureMode.Text = "Wave manipulation detected";
        }

    }
}